home *** CD-ROM | disk | FTP | other *** search
/ Fritz: All Fritz / All Fritz.zip / All Fritz / FILES / PROGNG_C / CSUBR.LZH / REVERSE.C < prev    next >
Text File  |  1985-04-11  |  170b  |  12 lines

  1. reverse(s)        /* reverse string s in place */
  2. char s[];
  3. {
  4.     int c, i, j;
  5.  
  6.     for (i=0, j=strlen(s)-1; i<j; i++, j--) {
  7.         c = s[i];
  8.         s[i] = s[j];
  9.         s[j] = c;
  10.     }
  11. }
  12.